home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!caren.demon.co.uk
- From: Loris Caren <loris@caren.demon.co.uk>
- Newsgroups: comp.arch.embedded,comp.sys.m68k
- Subject: Re: Flash programming tool for BDM
- Followup-To: comp.arch.embedded,comp.sys.m68k
- Date: Tue, 5 Mar 1996 09:23:17 GMT
- Organization: Caren Electronic Consultants
- Sender: usenet@caren.demon.co.uk
- Message-ID: <DnsFEu.Iq@caren.demon.co.uk>
- References: <4h1sc2$cq2@sdaw04.seinf.abb.se>
- X-NNTP-Posting-Host: caren.demon.co.uk
- X-Newsreader: TIN [UNIX 1.3 BETA-950824-color PL0]
- X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!caren.demon.co.uk
-
- background Debug Module support for Mote 683XX processors
-
- This note describes the facilities that I have developed for
- connecting my 486PC running Linux to the BDM port of a
- 683XX. Using a P+E ICD32 'dongle' connected to a secondary
- parrallel port I can communicate with the target processor
- in two different ways:-
-
- bdm
- bdm is a compiled binary which is based on Tcl (Tool Command
- Language). It extends the standard Tcl command set with
- additional commands which allow one to examine or set target
- processor registers or memory, tell the processor to run,
- etc. These primative operatives can be used in conjunction
- with the standard tcl commands to (for example) download
- code into an on-board Flash EPROM. For more details of Tcl
- get ISBN 0-201-63337-X or join comp.lang.tcl newsgroup.
- Here are my extensions to tcl:-
-
- register addr [value]
- peek addr [size]
- poke addr value [size]
- fill addr count value [size]
- stop
- go [addr]
- step [addr]
- reset
- dload srec
- wait
- quit
-
- gdb68
- The second interface to the bdm port has been made by
- creating a version of the gdb symbolic debugger with an
- additional target method compiled into it. This target bdm
- allows full symbolic debug and code download via the bdm
- port. Obviously breakpoint insertion are restricted to
- areas of target memory that are RAM. Because 683XX devices
- are almost totally configuarable via the SIM registers,
- these usually need to be initialised before code can be run,
- but it is simple to write gdb macros to do this.
-
- The code
- The code can be considered as being organised into 4 layers:-
-
- 1/ either the gdb code or TCL command extensions
- 2/ command functions such as int getRegister(int n)
- 3/ bit shifting and wiggling code specific to the ICD32 dongle
- 4/ mio - read/write device driver to control parallel port in a non
- centronics printer manner.
-
- Flash PEROM Blowing
- I am able to use the tcl based bdm tool described above to download code
- to Atmel Flash EPROMS (which I now do not socket). This is accomplished
- using tcl script which:-
- 1. Interogates the PEROM to determine what flavor it is and how big are
- the 'pages' it uses.
- 2. Downloads a small blower programme to the target RAM.
- 3. Downloads a 'page' of the code to be blown into RAM.
- 4. Runs the target blower code which copies the 'page' from RAM to the flash
- device (you can't write to the flash directly via the BDM cos it's not fast
- enough).
- 5. Wait for the blower code to finish and then repeat 3..5 for subsequent
- pages.
-
- I will gladly post this code to anybody who is interested, but note that you
- will have to build a new kernel before it can be run.
-